Skip to content

feat: Add granular telemetry signals decorator params and error classification#5963

Open
rsareddy0329 wants to merge 12 commits into
aws:masterfrom
rsareddy0329:master-granular-telemetry
Open

feat: Add granular telemetry signals decorator params and error classification#5963
rsareddy0329 wants to merge 12 commits into
aws:masterfrom
rsareddy0329:master-granular-telemetry

Conversation

@rsareddy0329

Copy link
Copy Markdown
Contributor

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

…r params and error classification

X-AI-Prompt: Implement granular telemetry signals for training, evaluation, and deployment
X-AI-Tool: Kiro IDE
@rsareddy0329 rsareddy0329 marked this pull request as ready for review June 22, 2026 02:53
@rsareddy0329 rsareddy0329 changed the title feat: Add granular telemetry signals with emit/emit_presence decorator feat: Add granular telemetry signals decorator params and error classification Jun 22, 2026
Comment on lines +80 to +81
if "validation" in error_type.lower() or "invalid" in error_msg or "must be" in error_msg:
return "validation_error"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"must be" seems vague could be anything .
Is there like a more exhaustive map of this ? Has this problem been solved elsewhere already in another library or so ?

Comment on lines +82 to +83
if "accessdenied" in error_msg or "not authorized" in error_msg or "forbidden" in error_msg:
return "auth_error"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does spacing/cases sensitivity work in these cases ?

If I get "access denied" the classification would be incorrect right

return "unknown"


def _attr_to_key(attr: str) -> str:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use existing snake to camel conversions ?

@rsareddy0329 rsareddy0329 Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

checked the existing converters https://github.com/aws/sagemaker-python-sdk/blob/a8011a4696157195b3d3ab4b4240eeaa3d0850cd/sagemaker-core/src/sagemaker/core/apiutils/_boto_functions.py:

  • to_camel_case (L19) -- produces PascalCase itself, same as below (training_type → TrainingType)
  • to_pascal_case (L31) -- produces PascalCase (training_type → TrainingType)

This function produce lowerCamelCase (training_type → trainingType) which we need to match existing telemetry keys (x-sdkVersion, x-endpointArn, x-latency).
we can update to_camel_case method but need to check other parts of code it is being used and few other files need to be updated, Can take this up seperately.

func_name="BedrockModelBuilder.deploy",
telemetry_params=[
("model_package", TelemetryParamType.ATTR_EXISTS),
("imported_model_kms_key_id", TelemetryParamType.KWARG_EXISTS),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we store this ?

feature=Feature.MODEL_CUSTOMIZATION,
func_name="BedrockModelBuilder.deploy",
telemetry_params=[
("model_package", TelemetryParamType.ATTR_EXISTS),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Model Package is fine .
How is Model data being stored here ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With ATTR_EXISTS, we capture emit whether it was successfully resolved (true) or not (false) -- we don't emit any model package data (no ARN, no name, no artifacts).

And regarding The model family (nova/oss) is already captured separately via the existing _is_nova_model_for_telemetry() method.

Comment on lines +389 to +390
@_telemetry_emitter(
feature=Feature.MODEL_CUSTOMIZATION,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a model dimension can be added to parameters as well

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_base_model_name is included in BASE_EVALUATOR_TELEMETRY_PARAMS which is shared by all evaluators (LLMAsJudge, Benchmark, CustomScorer, MultiTurnRL).
the resolved model name is taken via (e.g., meta-textgeneration-llama-3-2-1b-instruct) via ATTR_VALUE.

@nargokul nargokul left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add for pipelines as well ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants